var x,y,z,u,i,s,d,h......;
var star = "FF100020001C380001";
var end = "00320032003200321FFFFF";
if (index === 0) {
      switch (numPointsValue) {
          case 0:
              x = "0000";
              break;
          case 1:
              x = "000A";
              break;
          case 2:
              x = "0032";
              break;
          default:
          // Handle other cases if needed
      }
  }
  if (index === 1) {
    switch (numPointsValue) {
        case 0:
            y = "0000";
            break;
        case 1:
            y = "000A";
            break;
        case 2:
            y = "0032";
            break;
        default:
        // Handle other cases if needed
    }
}
if (index === 2) {
    switch (numPointsValue) {
        case 0:
            z = "0000";
            break;
        case 1:
            z = "000A";
            break;
        case 2:
            z = "0032";
            break;
        default:
        // Handle other cases if needed
    }
}
if (index === 3) {
    switch (numPointsValue) {
        case 0:
            u = "0000";
            break;
        case 1:
            u = "000A";
            break;
        case 2:
            u = "0032";
            break;
        default:
        // Handle other cases if needed
    }
}
.............
var str= star + x+y+z+u+...+end;
str += generateCRc16Modbus(str);
window.android.receiveMessageFromS6(str);